package cn.pcManage.common.controller;

import cn.common.common.model.ServerResponse;
import cn.pcManage.common.service.IUtilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * Created by Zhang on 2018/12/11.
 */
@RestController
@RequestMapping("/util")
public class UtilController {
    @Autowired
    IUtilService iUtilService;

    @PostMapping(value = "/uploadImg")
    public ServerResponse<?> uploadImg(@RequestParam("path") String path,
                                       @RequestParam("file") MultipartFile multipartFile,
                                       @RequestParam(value = "type",required = false) String type){
        return iUtilService.uploadImg(path,type,multipartFile);
    }
}
